package com.leslie.wukong.biz.system.controller;

import com.leslie.wukong.biz.system.domain.dto.SysUserAddDTO;
import com.leslie.wukong.biz.system.service.SysUserService;
import com.leslie.wukong.common.core.domain.RestResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * (wukong.sys_user)表控制层
 *
 * @author xxxxx
 */
@RestController
@RequestMapping("/sysUser")
@RequiredArgsConstructor
@Api(tags = "用户管理")
public class SysUserController {
    private final SysUserService service;

    @PostMapping("/add")
    @ApiOperation(value = "新增用户", tags = "用户管理")
    public RestResult<Integer> add(@RequestBody @Validated SysUserAddDTO dto) {
        return RestResult.ok(service.add(dto));
    }
}
